package day01;

import java.io.*;

public class BufferedWriterDemo01 {
    public static void main(String[] args) throws IOException {
        BufferedWriter bw = new BufferedWriter(
                new OutputStreamWriter(
                        new BufferedOutputStream(
                                new FileOutputStream(
                                        new File("D:\\1\\bw.txt"),true))));
        BufferedReader br = new BufferedReader(new InputStreamReader(
                new BufferedInputStream(
                        new FileInputStream(
                                new File("D:\\1\\ObjectTest.java")))));
        char[] buff = new char[1024];
        int len = -1;
        while((len=br.read(buff))!=-1) {
            bw.write(buff,0,len);
        }
        bw.close();
        br.close();
    }
}
